package com.juc.collections;

import java.util.*;

/**
 * @User 小菜鸡
 * @Data 2020/5/13
 */
public class MyCollections {

    public static void main(String[] args) {
        List list = new ArrayList<Integer>();
        //List list=new LinkedList();
        //可以将list变成线程安全的对象
        Collections.synchronizedList(list);

        HashMap<Integer, Object> map = new HashMap<>();
        //将map变成线程安全的对象
        Collections.synchronizedMap(map);

        HashSet<Object> set = new HashSet<>();
        Collections.synchronizedSet(set);

    }
}
